package com.hkbigdata.userprofile.common.util

import java.sql.{Connection, DriverManager, Statement}
import java.util.Properties

/**
 * @author liuanbo
 * @creat 2024-04-24-11:33
 * @see 2194550857@qq.com
 *
 */
object MyClickHouseUtil {

  private val properties: Properties = MyPropertiesUtil.load("config.properties")
  val CLICKHOUSE_URL = properties.getProperty("clickhouse.url")


  def executeSql(sql: String): Unit = {
    Class.forName("ru.yandex.clickhouse.ClickHouseDriver");
    val connection: Connection = DriverManager.getConnection("jdbc:clickhouse://192.168.6.113:8123/user_profile", null, null)
    val statement: Statement = connection.createStatement()
    statement.execute(sql)
    connection.close()

  }

}
